Cover TOC Chap Prev Chap Prev Fig Next Fig Next Chap

Chapter 8: Animating Position, Orientation, and Scale

../ch08/08fig05.gif
Figure 8.5

An animation that scales a coordinate system and the ball built within it.

08fig05.wrl
Click on the image to view the VRML scene.

#VRML V2.0 utf8
# The VRML 2.0 Sourcebook
# Copyright (c) 1997
# Andrea L. Ames, David R. Nadeau, and John L. Moreland
Group {
    children [
    # Pulsing ball
        DEF Ball Transform {
            children Shape {
                appearance Appearance {
                    material Material { }
                }
                geometry Sphere { }
            }
        },
    # Animation clock
        DEF Clock TimeSensor {
            cycleInterval 2.0
            loop TRUE
        },
    # Animation path
        DEF BallPath PositionInterpolator {
            key [ 0.0, 0.20, 0.65, 1.0 ]
            keyValue [
                1.0 1.0 1.0,
                1.5 1.5 1.5,
                1.1 1.1 1.1,
                1.0 1.0 1.0,
            ]
        }
    ]
}
ROUTE Clock.fraction_changed TO BallPath.set_fraction
ROUTE BallPath.value_changed TO Ball.set_scale